* (bug 17996) HTTP redirects are now combined when requesting a special page
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 10 Nov 2010 08:22:00 +0000 (08:22 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 10 Nov 2010 08:22:00 +0000 (08:22 +0000)
RELEASE-NOTES
includes/Wiki.php

index 7650126..7dc2623 100644 (file)
@@ -415,6 +415,7 @@ LocalSettings.php. The specific bugs are listed below in the general notes.
   $wgExternalLinkTarget
 * (bug 17789) Added a note to the total views on Special:Statistics saying that
   is doesn't count non-existing pages and special pages
+* (bug 17996) HTTP redirects are now combined when requesting a special page
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index ff80a97..7ae585b 100644 (file)
@@ -214,6 +214,12 @@ class MediaWiki {
                        && ( !$request->getVal( 'title' ) || $title->getPrefixedDBKey() != $request->getText( 'title' ) )
                        && !count( array_diff( array_keys( $request->getValues() ), array( 'action', 'title' ) ) ) )
                {
+                       if ( $title->getNamespace() == NS_SPECIAL ) {
+                               list( $name, $subpage ) = SpecialPage::resolveAliasWithSubpage( $title->getDBkey() );
+                               if ( $name ) {
+                                       $title = SpecialPage::getTitleFor( $name, $subpage );
+                               }
+                       }
                        $targetUrl = $title->getFullURL();
                        // Redirect to canonical url, make it a 301 to allow caching
                        if( $targetUrl == $request->getFullRequestURL() ) {